package com.pureut.scheduling.service;

import com.pureut.scheduling.domain.BackWeight;
import com.pureut.scheduling.domain.SchedulingExecution;
import com.pureut.scheduling.domain.SchedulingExecutionOn;
import com.pureut.scheduling.domain.SchedulingTake;
import com.pureut.scheduling.domain.dto.*;
import com.pureut.scheduling.domain.vo.*;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * @Description
 * @Param
 * @Date
 * @Author hl
 **/
public interface ISchedulingProductionService {

    /**
     * 查询生产排程
     */
    List<SchedulingProductionDto> selectProductionList(SchedulingProductionVo schedulingProductionVo);

    /**
     * 手动下达
     */
    int insertSchedulingManual(SchedulingExecutionOn schedulingExecutionVo);

    /**
     * 排程单撤回
     */
    int deleteExecutionById(long executionId) throws Exception;

    /**
     * 查询单个信息
     */
    ProductionMaterialDto selectProductionById(long productionId);

    SchedulingExecution getStartWork(long lineId, String materialCode,int widthCloth) throws ParseException, SQLException;

    int confirmSchedulingExecution(long executionId) throws Exception;


    /**
     * 查询生产排程(下达后)
     */
    List<SchedulingExecutionDto> selectSchedulingExecution(SchedulingExecutionVo schedulingExecutionVo);

    /**
     * 返回对应类
     */
    SchedulingExecutionMeter getFinishWork(SchedulingExecutionMeterVo schedulingExecutionMeterVo) throws ParseException;

    /**
     * T+N锁定
     */
    int insertSchedulingLock(SchedulingLockVo schedulingLockVo);

    /**
     * 甘特图展示
     */
    List<GanttChartDto> selectGanttChart() throws ParseException;

    /**
     * 甘特图拖拽
     */
    int ganttChartEdit(GanttChartVo ganttChartVo);

    /**
     * 和并下达
     */
    List<ProductionMaterialDto> selectProductionCombined(String productionIdS);

    /**
     * 合并下达排程单
     */
    int insertSchedulingCombinedThe(List<SchedulingExecutionOn> formList);

    /**
     * 校验分切数量是否符合规则
     */
    int getCheckSlitting(int executionSlitting,int widthCloth);

    /**
     * 返回物料信息以及相应重量
     */
    List<MaterialRatioDto> getMaterialRatio(String materialCode, double schedulingWeight);

    int updateBackAdjust(BackAdjustVo backAdjustVo);

    int updateBackWeight(BackWeight backWeight);

    Date selectFinishTime(SchedulingTake schedulingTake) throws ParseException;

    /**
     * 查询bom返回仓库数据及所需用量
     * @param materialCode
     * @param schedulingWeight
     * @param bomId
     * @param lineId
     * @param trimmingWeight
     * @return
     */
    List<BomDetailDto> queryBom(String materialCode, double schedulingWeight, Long bomId, Long lineId,double trimmingWeight);
}
